package com.gsoe.problem.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsoe.problem.po.ExamProblem;
import com.gsoe.problem.po.Problem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 考试题目中间表 Mapper 接口
 * </p>
 *
 * @author xiaoma
 * @since 2024-10-27
 */
public interface ExamProblemMapper extends BaseMapper<ExamProblem> {
    List<Problem> getProblemListByExamId(@Param("examId") Long examId,@Param("needPeople")Integer needPeople);

    @Select(("select ep.score from exam_problem as ep inner join problem as p on ep.problem_id = p.id where ep.exam_id=#{examId} and p.type=#{type} limit 1"))
    Integer getScore(@Param("examId") Long examId,@Param("type") int type);
}
